<extend name="admin/main"/>

<block name="title">
    <title>新闻分栏</title>
</block>

<block name="css"></block>

<block name="heading">新闻分栏</block>
<block name="content">
    <table border="1" width="800px" class="table table-bordered table-hover">
        <tr>
            <foreach name="date" item="item" key="key">
                <th class="text-center text-uppercase ">
                    {$item.title}
                </th>
                <th class="text-center text-uppercase ">
                    <a href="/admin/News/categories_update?id={$item.id}">更改/</a>
                    <a href="/admin/News/categories_delete?id={$item.id}">删除</a>
                </th>
            </foreach>
        </tr>
    </table>

        <div class="h3">栏目更改</div>
        <form class="form-horizontal" method="post" action="/admin/news/categories_save">
            <div class="form-group mb-md">
                <label for="title" class="col-xs-2 control-label">栏目标题</label>
                <div class="col-xs-6">
                    <input type="text" class="form-control" name="title" id="title" required>
                </div>
                <input type="hidden" name="id" value="{$id}">
                <button class="btn btn-success" type="submit">更改</button>
            </div>
        </form>

    <div class="h3">添加分栏</div>
    <form class="form-horizontal" method="post" action="/admin/news/category/add">
        <div class="form-group mb-md">
            <label for="title" class="col-xs-2 control-label">栏目标题</label>
            <div class="col-xs-6">
                <input type="text" class="form-control" name="title" required>
            </div>
            <button class="btn btn-success" type="submit">添加</button>
        </div>
    </form>
</block>

<block name="js">
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/demo/demo-switcher.js"></script>
    <script type="text/javascript" src="__PUBLIC__/assets/plugins/bootbox/bootbox.js"></script>

    <script type="text/javascript"
            src="__PUBLIC__/assets/plugins/form-pagedown/js/jquery.pagedown-bootstrap.combined.js">
    </script>
    <script>
        $(document).ready(function () {
            $("textarea#content").pagedownBootstrap();
            $('.wmd-preview').addClass('well');
        });
    </script>
</block>



